package lab02.test11;

public class Square extends Rectangle {

    double diagonal(){
        height = width;
        return Math.sqrt(2)*width;
    }



    @Override
    public void printMyWay() {
        System.out.println("正方形的边长："+width);
        System.out.println("正方形的面积："+area());
        System.out.println("正方形的周长："+perimeter());
    }
}
